load("@rules_python//python:defs.bzl", "py_binary")
load("//bazel:build.bzl", "redpanda_cc_library")

py_binary(
    name = "compiler",
    srcs = ["rpc_compiler.py"],
    main = "rpc_compiler.py",
    visibility = ["//visibility:public"],
    deps = [
        "@python_deps//jinja2",
    ],
)

redpanda_cc_library(
    name = "rpc",
    srcs = [
        "connection_cache.cc",
        "connection_set.cc",
        "netbuf.cc",
        "reconnect_transport.cc",
        "rpc_server.cc",
        "rpc_utils.cc",
        "transport.cc",
        "types.cc",
    ],
    hdrs = [
        "backoff_policy.h",
        "connection_cache.h",
        "connection_set.h",
        "errc.h",
        "exceptions.h",
        "fwd.h",
        "logger.h",
        "parse_utils.h",
        "reconnect_transport.h",
        "response_handler.h",
        "rpc_server.h",
        "rpc_utils.h",
        "service.h",
        "transport.h",
        "types.h",
    ],
    include_prefix = "rpc",
    visibility = ["//visibility:public"],
    deps = [
        "//src/v/base",
        "//src/v/bytes:iobuf",
        "//src/v/bytes:iostream",
        "//src/v/bytes:scattered_message",
        "//src/v/compression",
        "//src/v/config",
        "//src/v/hashing:crc32c",
        "//src/v/hashing:xx",
        "//src/v/metrics",
        "//src/v/model",
        "//src/v/net",
        "//src/v/reflection:adl",
        "//src/v/serde",
        "//src/v/ssx:future_util",
        "//src/v/ssx:semaphore",
        "//src/v/ssx:sformat",
        "//src/v/utils:log_hist",
        "//src/v/utils:mutex",
        "//src/v/utils:named_type",
        "//src/v/utils:to_string",
        "//src/v/utils:unresolved_address",
        "@abseil-cpp//absl/container:btree",
        "@abseil-cpp//absl/container:flat_hash_map",
        "@abseil-cpp//absl/container:flat_hash_set",
        "@boost//:crc",
        "@fmt",
        "@seastar",
    ],
)
